package com.ziytek.web.citizen.model.vo;

import com.ziytek.web.citizen.model.bean.BatchNoDetail;
import lombok.Data;
import org.springframework.util.CollectionUtils;

import java.util.ArrayList;
import java.util.List;

/**
 * 每天批次号列表数据
 *
 * @author fenghx
 */
@Data
public class DayBatchNoVo {
    /**
     * 日期 格式: yyyy-MM-dd
     */
    private String day;

    /**
     * 批次列表数据 每个批次号 格式: yyyy-MM-dd HH:mm:ss
     */
    private List<String> batchNoList;
    /**
     * 批次详情列表数据
     */
    private List<BatchNoDetail> batchNoDetailsList;

    public void setList(String batchNo) {
        if (CollectionUtils.isEmpty(batchNoList)) {
            batchNoList = new ArrayList<>();
        }
        batchNoList.add(batchNo);
    }

    public void setDetailList(BatchNoDetail batchNoDetail) {
        if (CollectionUtils.isEmpty(batchNoDetailsList)) {
            batchNoDetailsList = new ArrayList<>();
        }
        if (null != batchNoDetail) {
            batchNoDetailsList.add(batchNoDetail);
        }
    }
}
